<?php

require_once 'init.php';
require_once 'cf/shop.php';
require_once 'cf/api/shop.php';


$find = trim(cf\param::asString('find'));
$findParts = preg_split('/\s+/',$find,PREG_SPLIT_NO_EMPTY);

$smarty->assign('categoriesFound',cf\api\shop\findCategories($findParts,'/catalog'));

$products = new cf\Products;
$products->find($findParts, true);

$smarty->assign('products',$products->getList());

show(
	'search', 
	'Поиск', 
	array(array('name'=>'Поиск'))
);

?>